package org.example.clouddemo.recommend.controller.app;

import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.example.clouddemo.recommend.service.common.RecommendService;
import org.example.clouddemo.bean.common.entity.Product;
import org.example.common.response.ApiResult;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api(tags = "推荐接口")
@ApiSupport(order = 1)
@RequiredArgsConstructor
@RestController("appRecommendController")
@RequestMapping("/api/app/recommend")
public class RecommendController {

    private final RecommendService recommendService;

    @ApiOperation(value = "基于用户id的推荐列表", notes = "需要token")
    @PostMapping("list")
    public ApiResult<List<Product>> list() {
        List<Product> result = recommendService.recommendProductListByUserId();
        return ApiResult.success(result);
    }

}
